home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / twinopus / dopus / parent.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-02-21  |  1.2 KB  |  52 lines

  1. /*
  2.  *
  3.  * Go to the parent directory in TwinExpress from DOpus.
  4.  *
  5.  * (c) 1994 by K.P. van Beem (2:280/464.2, patrick.van.beem@aobh.xs4all.nl)
  6.  *
  7.  * Based on the DOpusLhaARexx package by Geoff Seeley (but you can better
  8.  * use GuiArc in stead of DOpus and a script, to deal with archives)
  9.  *
  10.  *    Mods  By Ray Abram
  11.  *     - If called on a DOpus Dir, then will tell Dopus to do a Parent
  12.  *
  13.  */
  14.  
  15. DOpusPort   = 'DOPUS.1'
  16.  
  17. if ~show(l,"rexxsupport.library") then        
  18.     call addlib("rexxsupport.library",0,-30,0)
  19. if showlist('Ports', DOpusPort) = 0 then do
  20.    say 'Directory Opus Arexx port not found. Aborting.'
  21.    exit
  22. end
  23.  
  24. address 'DOPUS.1'
  25. options results
  26.  
  27. /* setup DOpus window and tell user what's happening */
  28. Busy on
  29. TopText "Getting directory, please wait..."
  30.  
  31.  
  32. /* Get the current directory */
  33. 'Status 6 -1'
  34. GetEntry Result
  35. FilePath = Result
  36. if left(FilePath,1) ~= '*' then do
  37.    TopText "You are not in a 'Twin' directory. ??"
  38.    Busy off
  39.    Parent
  40.    exit
  41. end
  42. FilePath = SubStr(FilePath,2)
  43. if right(FilePath,1) = ':' then do
  44.    TopText "You are already at the root ??"
  45.    Busy off
  46.    exit
  47. end
  48. Slash=LastPos('/',FilePath)
  49. if Slash = 0 then Slash=LastPos(':',FilePath)+1
  50. FilePath = Left(FilePath,Slash-1)
  51. address AREXX "Rexx:DOpus/ReadDir.rexx" FilePath
  52.